import request from '@/utils/request'


export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/user/getInfo',
    method: 'get'
  })
}

export function getNames() {
  return request({
    url: '/user/getNames',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/user/logout',
    method: 'get'
  })
}

export function getInfoList() {
  return request({
    url: '/user/getInfoList',
    method: 'get'
  })
}

export function resetPwd(userId, password) {
  return request({
    url: '/user/updatePassword',
    method: 'POST',
    params: { userId: userId, password: password }
  })
}

export function deleteUser(userId) {
  return request({
    url: '/user/deleteUser',
    method: 'POST',
    params: { userId: userId }
  })
}

export function checkRegistered(userName) {
  return request({
    url: '/user/getIsRegistered',
    method: 'GET',
    params: { userName: userName }
  })
}

export function createOrUpdate(data) {
  return request({
    url: '/user/addOrUpdateUser',
    method: 'POST',
    data: data
  })
}

export function getUserPageInfos(data) {
  return request({
    url: '/user/getPageInfos',
    method: 'GET',
    params: data
  })
}

export function updateUserRoles(data) {
  return request({
    url: '/user/updateUserRoles',
    method: 'POST',
    data: data
  })
}


export function getStationSVG(){
  return request({
    url:'http://127.0.0.1:3007/iSTP.svg',
    method:get
  })
}


export function getStationMap() {
  return request({
    url: '/linedata/stationMapData',
    method: 'get'
  })
}  

export function getStationInfos() {
  return request({
    url: '/linedata/stationInfos',
    method: 'get'
  })
}


export function getLineData() {
  return request({
    url: '/linedata/getLineData',
    method: 'get'
  })
}



export function getDSS(id) {
  return request({
    url: '/dss/stationDSS',
    method: 'get',
    params: { stationNo: id }
  })
}

export function TWS(id) {
  return request({
    url: '/tws-rt/TWS_Entitys',
    method: 'get',
    params: { deviceType: id }
  })
}  

export function getStatus() {
  return request({
    url: '/dss/stationStatus_DSS',
    method: 'get'
  })
} 

export function getTrainPageInfos() {
  return request({
    url: '/device/getInfoList',
    method: 'GET',

  })
}

export function getStationNames() {
  return request({
    url: '/station/getNoNames',
    method: 'GET',
  })
}

export function addOrUpdateMemberStations(data) {
  return request({
    url: '/station/addOrUpdateMemberStations',
    method: 'POST',
    data: data
  })
}

export function getJobTypeNames() {
  return request({
    url: '/jobType/getNames',
    method: 'GET',
  })
}

export function getTaskTypeNames() {
  return request({
    url: '/taskType/getNames',
    method: 'GET',
  })
}

export function getVehiclesInfo(data) {
  return request({
    url: '/frontEnd/vehiclesInfo',
    method: 'get',
    params: data
  })
}

export function getTaskInfo() {
  return request({
    url: '/curDoing',
    method: 'get',
  })
}

export function deleteTask(taskId) {
  return request({
    url: '/delete',
    method: 'delete',
    params: { taskId }
  })
}

export function postTaskInfo(taskinfo) {
  return request({
    url: '/taskCreate',
    method: 'post',
    data:taskinfo
  })
}

export function putSqfl(data) {
  return request({
    url: '/sqfl/',
    method: 'put',
    data:data
  })
}

export function getGeoDatas() {
  return request({
    url: '/station/position',
    method: 'get'
  })
}

export function getWorkItemHung(data) {
  return request({
    url: '/workItem/curHung',
    method: 'GET',
    params: data
  })
}
